package org.jeecg.modules.shiro.authc;

import lombok.Getter;
import lombok.Setter;
import org.apache.shiro.authc.AuthenticationToken;

/**
 * @Author Scott
 * @create 2018-07-12 15:19
 * @desc
 **/
@Getter
public class JwtToken implements AuthenticationToken {

    private static final long serialVersionUID = 1L;
    @Setter
    private String token;

    private String username;

    private String password;

    private String phone;

    private String salt;

    /**
     * 登陆平台
     */
    private Integer platform;

    public JwtToken(String token) {
        this.token = token;
    }

    public JwtToken(Integer platform, String token) {
        this.platform = platform;
        this.token = token;
    }

    public JwtToken(String username, String password, String phone, String salt, Integer platform) {
        this.username = username;
        this.password = password;
        this.phone = phone;
        this.salt = salt;
        this.platform = platform;
    }

    @Override
    public Object getPrincipal() {
        return this;
    }

    @Override
    public Object getCredentials() {
        return token;
    }
}
